package com.seu.project.seuquiz.model.converter;

import com.seu.project.seuquiz.model.dto.collegeContestMap.CollegeContestMapUpdateRequest;
import com.seu.project.seuquiz.model.entity.CollegeContestMap;

/**
 * @author SoftPro
 * @createDate: 2023-07-16 16:26
 */
public class CollegeContestMapConverter {

    /**
     * CollegeContestMapUpdateRequest 转换为 CollegeContestMap
     * @param updateRequest
     * @return
     */
    public static CollegeContestMap collegeContestMapUpdateRequestToCollegeContestMap(CollegeContestMapUpdateRequest updateRequest) {
        if (updateRequest == null) {
            return null;
        }

        return CollegeContestMap.builder()
                .id(updateRequest.getId())
                .collegeName(updateRequest.getCollegeName())
                .contestId(updateRequest.getContestId())
                .collegeStudentTotal(updateRequest.getCollegeStudentTotal())
                .joinTotal(updateRequest.getJoinTotal())
                .totalScore(updateRequest.getTotalScore())
                .build();
    }
}
